package com.ulook.lookplanet.mapper;

import com.ulook.lookplanet.bean.TCommunity;
import com.ulook.lookplanet.bean.TTopic;
import com.ulook.lookplanet.bean.TUser;
import com.ulook.lookplanet.bean.VArticlePreInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 描述：
 *
 * @author L1998
 * @date 2021/5/13
 */
@Mapper
@Repository
public interface ManageMapper {

    @Select("select * from t_user where id = #{id}")
    TUser getTUserById(@Param("id") int id);

    /**
     * 冻结
     */
    void freeze(int id, int state);

    /**
     * 删除账户
     */
    void deleteUser(int id);

    /**
     * 搜索用户
     */
    List<TUser> searchUser(String key1, String key2);

    /**
     * 搜索动态
     */
    List<VArticlePreInfo> searchArticle(String s, int itemNum);

    /**
     * 删除动态
     */
    void deleteArticle(String uid);

    /**
     * 获取话题分组
     */
    List<TCommunity> getComList();

    /**
     * 添加话题
     */
    void addTopic(TTopic tTopic);

    /**
     * 判断话题名是否已存在
     */
    int hasTopicName(String name);

    /**
     * 删除话题
     */
    void deleteTopic(String name);

}
